const BasicLogin = require('../BasicLogic.js');
module.exports = class extends BasicLogin {
  // get scope() {
  //   return {
  //     num: {
  //       string: true,
  //       // 十位数学号
  //       required: true
  //       // 必填
  //     },
  //     password: {
  //       string: true,
  //       required: true
  //     }
  //   };
  // }
  loginAction() {
    console.log('logic: user/user/login');
    this.allowMethods = 'post';
    this.rules = {
      num: {
        string: true,
        // 十位数学号
        required: true
        // 必填
      },
      password: {
        string: true,
        required: true
      }
    };
  }
  addAction() {
    this.allowMethods = 'post';
    this.rules = {
      role_id: {
        string: true,
        required: true
      },
      num: {
        string: true,
        // 十位数学号
        required: true
        // 必填
      },
      password: {
        string: true,
        required: true
      }
    };
  }
  resetAction() {
    this.allowMethods = 'post';
    this.rules = {
      Stu_Num: {
        string: true,
        required: true,
        length: {min: 8, max: 10}
      },
      Stu_Name: {
        string: true,
        required: true
      },
      Stu_Tel: {
        string: true,
        required: true,
        mobile: 'zh-CN'
      }
    };
  }
  delimgAction() {
    this.allowMethods = 'delete';
    this.rules = {
      id: {
        string: true,
        required: true
      }
    };
  }
  editstateAction() {
    this.allowMethods = 'post';
    this.rules = {
      id: {
        string: true,
        required: true
      }
    };
  }
};
